package com.lgh.springframework.context.support;

import com.lgh.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.lgh.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname AbstractXmlApplicationContext
 * @description
 * @date 2023/02/25 14:52
 * <p>
 * ******************************************************
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocations = getConfigLocations();
        if (null != configLocations) {
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }

    protected abstract String[] getConfigLocations();

}
